package com.openbravo.pos.ticket;

import com.openbravo.basic.BasicException;
import com.openbravo.data.loader.DataRead;
import com.openbravo.data.loader.ImageUtils;
import com.openbravo.data.loader.SerializerRead;
import com.openbravo.format.Formats;
import java.awt.image.BufferedImage;
import java.util.Properties;

public class ProductInfoExt
{
  private static final long serialVersionUID = 7587696873036L;
  protected String m_ID = null;
  protected String m_sRef = "0000";
  protected String m_sCode = "0000";
  protected String m_sName = null;
  protected boolean m_bCom = false;
  protected boolean m_bScale = false;
  protected String categoryid = null;
  protected String taxcategoryid = null;
  protected String attributesetid = null;
  protected double m_dPriceBuy = 0.0D;
  protected double m_dPriceSell = 0.0D;
  protected BufferedImage m_Image = null;
  protected Properties attributes = new Properties();

  public final String getID()
  {
    return this.m_ID;
  }

  public final void setID(String paramString)
  {
    this.m_ID = paramString;
  }

  public final String getReference()
  {
    return this.m_sRef;
  }

  public final void setReference(String paramString)
  {
    this.m_sRef = paramString;
  }

  public final String getCode()
  {
    return this.m_sCode;
  }

  public final void setCode(String paramString)
  {
    this.m_sCode = paramString;
  }

  public final String getName()
  {
    return this.m_sName;
  }

  public final void setName(String paramString)
  {
    this.m_sName = paramString;
  }

  public final boolean isCom()
  {
    return this.m_bCom;
  }

  public final void setCom(boolean paramBoolean)
  {
    this.m_bCom = paramBoolean;
  }

  public final boolean isScale()
  {
    return this.m_bScale;
  }

  public final void setScale(boolean paramBoolean)
  {
    this.m_bScale = paramBoolean;
  }

  public final String getCategoryID()
  {
    return this.categoryid;
  }

  public final void setCategoryID(String paramString)
  {
    this.categoryid = paramString;
  }

  public final String getTaxCategoryID()
  {
    return this.taxcategoryid;
  }

  public final void setTaxCategoryID(String paramString)
  {
    this.taxcategoryid = paramString;
  }

  public final String getAttributeSetID()
  {
    return this.attributesetid;
  }

  public final void setAttributeSetID(String paramString)
  {
    this.attributesetid = paramString;
  }

  public final double getPriceBuy()
  {
    return this.m_dPriceBuy;
  }

  public final void setPriceBuy(double paramDouble)
  {
    this.m_dPriceBuy = paramDouble;
  }

  public final double getPriceSell()
  {
    return this.m_dPriceSell;
  }

  public final void setPriceSell(double paramDouble)
  {
    this.m_dPriceSell = paramDouble;
  }

  public final double getPriceSellTax(TaxInfo paramTaxInfo)
  {
    return this.m_dPriceSell * (1.0D + paramTaxInfo.getRate());
  }

  public String printPriceSell()
  {
    return Formats.CURRENCY.formatValue(new Double(getPriceSell()));
  }

  public String printPriceSellTax(TaxInfo paramTaxInfo)
  {
    return Formats.CURRENCY.formatValue(new Double(getPriceSellTax(paramTaxInfo)));
  }

  public BufferedImage getImage()
  {
    return this.m_Image;
  }

  public void setImage(BufferedImage paramBufferedImage)
  {
    this.m_Image = paramBufferedImage;
  }

  public String getProperty(String paramString)
  {
    return this.attributes.getProperty(paramString);
  }

  public String getProperty(String paramString1, String paramString2)
  {
    return this.attributes.getProperty(paramString1, paramString2);
  }

  public void setProperty(String paramString1, String paramString2)
  {
    this.attributes.setProperty(paramString1, paramString2);
  }

  public Properties getProperties()
  {
    return this.attributes;
  }

  public static SerializerRead getSerializerRead()
  {
    return new SerializerRead()
    {
      public Object readValues(DataRead paramDataRead)
        throws BasicException
      {
        ProductInfoExt localProductInfoExt = new ProductInfoExt();
        localProductInfoExt.m_ID = paramDataRead.getString(1);
        localProductInfoExt.m_sRef = paramDataRead.getString(2);
        localProductInfoExt.m_sCode = paramDataRead.getString(3);
        localProductInfoExt.m_sName = paramDataRead.getString(4);
        localProductInfoExt.m_bCom = paramDataRead.getBoolean(5).booleanValue();
        localProductInfoExt.m_bScale = paramDataRead.getBoolean(6).booleanValue();
        localProductInfoExt.m_dPriceBuy = paramDataRead.getDouble(7).doubleValue();
        localProductInfoExt.m_dPriceSell = paramDataRead.getDouble(8).doubleValue();
        localProductInfoExt.taxcategoryid = paramDataRead.getString(9);
        localProductInfoExt.categoryid = paramDataRead.getString(10);
        localProductInfoExt.attributesetid = paramDataRead.getString(11);
        localProductInfoExt.m_Image = ImageUtils.readImage(paramDataRead.getBytes(12));
        localProductInfoExt.attributes = ImageUtils.readProperties(paramDataRead.getBytes(13));
        return localProductInfoExt;
      }
    };
  }

  public final String toString()
  {
    return this.m_sRef + " - " + this.m_sName;
  }
}

/* Location:           D:\PowerFulPOS-2.30.2\openbravopos.jar
 * Qualified Name:     com.openbravo.pos.ticket.ProductInfoExt
 * JD-Core Version:    0.6.0
 */